#ifndef GWIDGETBAR_H
#define GWIDGETBAR_H

#include <QtGui>
#include "gwidget_global.h"
#include "qchartviewer.h"
#include "RTDataIO.h"

class GRAPHWIDGETSHARED_EXPORT GWidgetBar : public QWidget {
    Q_OBJECT
public:
    GWidgetBar(QWidget *parent = 0);
    ~GWidgetBar();
	static GWidgetBar*	CopyWidget(GWidgetBar *w);
	void				setWidgetRealTime(bool b);
	void				ConfigWidget();
	void				RepaintView();

	QString				m_strTitle1, m_strTitle2;
	QString				m_strYLable;
	QString				m_strXLable[MAX_DATALINK_BAR];
	XDataLinkEx			m_LinkInfo[MAX_DATALINK_BAR];
	double				m_dfValue[MAX_DATALINK_BAR];

protected:
    void				resizeEvent(QResizeEvent* e);
private:
	QChartViewer*		m_chartviewer;
	void				Init_CurveView(QChartViewer* viewer,bool printState,QString fileName="");
	void				SetXYData();

	bool				m_bRealTime;
public slots:
	void				OnViewPortChanged();
};

#endif // GWIDGETBAR_H
